﻿using OrBitDataModule.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ScriptRunner
{
    internal static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string ipcPortName = string.Empty;
            string ipcObjectUri = string.Empty;
            string uniqueId = string.Empty;
            string userName = string.Empty;
            string password = string.Empty;

            CommandLineParser.TryParseCommandLine(args, out uniqueId, out userName, out password, out ipcPortName, out ipcObjectUri);
            //HideForm form = new HideForm(ipcPortName, ipcObjectUri);
            ////form.Size = new System.Drawing.Size(1, 1);
            //form.ShowInTaskbar = false;
            //form.WindowState = FormWindowState.Minimized;
            //form.FormBorderStyle = FormBorderStyle.None;
            //Application.Run(form);
            SharedData.LoginUserName = userName;
            SharedData.LoginUserPassword = password;
            Scripter scripter = new Scripter(uniqueId, userName, password, ipcPortName, ipcObjectUri);
            Application.Run();
        }
    }
}
